// locutor
// (c) 2009, Normen Müller, normen.mueller@gmail.com  
// $Id: RegistrySpecInit.scala 74 2010-05-07 21:01:48Z normen.mueller $
package locutor.spec.registry

import org.specs._

import java.io.File
import scaup.Views._
import scala.xml.XML
import locutor.svn.reg._
import locutor.spec.Util._

object RegistrySpecInit extends Specification("Initialization") {
  def throwExceptions = addToSusVerb("throw exceptions due to")  
  "Initialization" should throwExceptions {
    "invalid parameters" in {
        new Registry(null) must throwA[RegistryError]
        new Registry(TMP) must throwA[RegistryError]
    }
    "invalid XML" in {
      val invalid = (TMP/"invalid.xml")
      invalid.remove()
      val in = invalid.touch match {case Some(f) => f case None => fail}
      val out = new java.io.BufferedWriter(new java.io.FileWriter(in))
      out.write("""<?xml version="1.0" encoding="UTF-8"?>""")
      out.close()      
      
      new Registry(invalid) must throwA[RegistryError]
    }
    "to wrong registry version" in {
      (TMP/"tmpreg.xml").remove()
      XML.save((TMP/"tmpreg.xml").ap, (<registry xmlns="http://locutor.kwarc.info/" version="4711" />))
      new Registry((TMP/"tmpreg.xml")) must throwA[RegistryError]
      (TMP/"tmpreg.xml").remove()
    }
    "wrong registry namespace" in {
      (TMP/"tmpreg.xml").remove()
      XML.save((TMP/"tmpreg.xml").ap, (<registry xmlns="http://foo.bar" version="0.1" />))
      new Registry((TMP/"tmpreg.xml")) must throwA[RegistryError]
      (TMP/"tmpreg.xml").remove()
    }	
  }

  
  "Initialization with transexs to parent paths" should {   
    "decode such that all transexs are dereferencable" in {
      resetAllWC()
      setupWC("wca")
      svnSetExternal("wca/a", (-1, URLA, "a"))
      svnCommit("wca", "")
      
      /* Faking WCA to be santized */
      (WCA/"a/a").remove()
      (WCA/"a/a") linkTo WCA.path
      
      /* So Registry should look like this ... */
      val xml = 
        (<registry version="0.1" xmlns="http://locutor.kwarc.info">
           <wc xml:id={WCA.path.toMD5} url={URLA} root={WCA.path}>
             <external xml:id={(WCA/"a/a").path.toMD5} own={(WCA/"a").path} rev="-1" url={URLA} tgt="a" xref={"#"+WCA.path.toMD5}/>
           </wc>
         </registry>)
      
      /* ... serialize to the same */
      val r = setupRegistry(xml)
      r.serialize()
      
      XML.loadFile(REG) must ==/(xml)
    }
  }
  
  
  "Initialization with transexs to sibling paths" should {
    "decode such that all transexs are dereferencable (1st example)" in {
      setupWC("wca")
      svnSetExternal("wca/a", (-1, (URLA.toURI/"b").toString, "a"))
      svnCommit("wca", "")
      
      /* Faking WCA to be santized */
      (WCA/"a/a").remove()
      (WCA/"a/a") linkTo (WCA/"b").path
      
      /* So Registry should look like this ... */
      var xml = 
        (<registry version="0.1" xmlns="http://locutor.kwarc.info">
           <wc xml:id={WCA.path.toMD5} url={URLA} root={WCA.path}>
             <external xml:id={(WCA/"a/a").path.toMD5} own={(WCA/"a").path} rev="-1" url={(URLA.toURI/"b").toString} tgt="a" xref={"#"+WCA.path.toMD5}/>
           </wc>
         </registry>)
      
      /* ... serialize to the same */
      var r = setupRegistry(xml)
      r.serialize()
      
      XML.loadFile(REG) must ==/(xml)
    }
    "decode such that all transexs are dereferencable (2nd example)" in {
      setupWC("wch")
      svnUpdate("wch")
      
      /* Now we are faking the following sanitation of wch:
       * wch/doc/macros/cm --> wch/projects/dockon/doc/macros/cm
       *                       wch/projects/dockon/doc/macros --> wch/doc/macros
       * 
       * !!! NOOOOO!  This causes an infinite loop of symbolic links, man !!!
       *
       * ioRemove("wch/doc/macros/cm")
       * (TMP/"wch/doc/macros/cm") linkTo (TMP/"wch/projects/dockon/doc/macros/cm").path
       * ioRemove("wch/projects/dockon/doc/macros")
       * (TMP/"wch/projects/dockon/doc/macros") linkTo (TMP/"wch/doc/macros").path
       */
                 
      ioRemove("wch/projects/dockon/doc/macros")
      (TMP/"wch/projects/dockon/doc/macros") linkTo (TMP/"wch/doc/macros").path
      
      /* So Registry should look like this ... */
      val xml = 
        (<registry version="0.1" xmlns="http://locutor.kwarc.info">
           <wc xml:id={WCH.path.toMD5} url={URLH} root={WCH.path}>
             <external xml:id={(WCH/"doc/macros/cm").path.toMD5} own={(WCH/"doc/macros").path} rev="-1" url={URLA} tgt="cm"/>
             <external xml:id={(WCH/"projects/dockon/doc/macros").path.toMD5} own={(WCH/"projects/dockon/doc").path} rev="-1" url={(URLH.toURI/"doc/macros").toString} tgt="macros" xref={"#"+WCH.path.toMD5}/>
           </wc>
         </registry>)
      
      /* ... serialize to the same */
      val r = setupRegistry(xml)
      r.serialize()
      
      XML.loadFile(REG) must ==/(xml)
    }
  }
  
  
  "Initialization with transexs to other working copy paths" should {
    "decode such that all transexs are dereferencable" in {
      setupWC("wca")
      setupWC("wcb")
      setupWC("wcc")
      
      /* Faking WCB to be santized */
      (WCB/"a").remove()
      (WCB/"a") linkTo WCA.path
      
      /* Faking WCC to be santized */
      (WCC/"a").remove()
      (WCC/"a") linkTo WCB.path
      
      /* So Registry should look like this ... */
      val xml = 
        (<registry version="0.1" xmlns="http://locutor.kwarc.info">
           <wc xml:id={WCA.path.toMD5} url={URLA} root={WCA.path}/>
           <wc xml:id={WCB.path.toMD5} url={URLB} root={WCB.path}>
             <external xml:id={(WCB/"a").path.toMD5} own={WCB.path} rev="-1" url={URLA} tgt="a" xref={"#"+WCA.path.toMD5}/>
           </wc>
           <wc xml:id={WCC.path.toMD5} url={URLC} root={WCC.path}>
             <external xml:id={(WCC/"a").path.toMD5} own={WCC.path} rev="-1" url={URLB} tgt="a" xref={"#"+WCB.path.toMD5}/>
           </wc>         
         </registry>)
      
      /* ... serialize to the same */
      val r = setupRegistry(xml)
      r.serialize()
      
      XML.loadFile(REG) must ==/(xml)
    }
  }
  
  "Initialization with transexs" should {   
    "decode such that all transexs are dereferencable (1st example)" in {
      val xml = 
        (<registry version="0.1" xmlns="http://locutor.kwarc.info">
  <wc xml:id="9-536954-12-99619577212-1053-3871" root="/Users/nmueller/tmp/miko/kwarc.info/kwarc" url="https://svn.kwarc.info/repos/kwarc">
    <external 
    xml:id="-124-799810310926-321961103926-786-20-2" tgt="jem" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/administration/finances" url="https://svn.kwarc.info/repos/kwarc/projects/JEM/eu" xref="#9-536954-12-99619577212-1053-3871" rev="-1">
</external>
    <external xml:id="89-43-12653-11-11885-12-916248-61-34-1057366" tgt="once-cs" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/administration/finances" url="https://svn.kwarc.info/repos/once-cs/admin/contract" rev="-1">
    </external>
    <external xml:id="11-1763-6518771-106125-98-5861-367490-21" tgt="panta-rhei" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/doc/flyers" url="https://svn.kwarc.info/repos/pantarhei/doc/flyer" rev="-1"/>
    <external xml:id="-54-10642-78-6133-63-101828253126-3690-79-64" tgt="swim" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/doc/flyers" url="https://svn.kwarc.info/repos/swim/doc/flyer" rev="-1"/>
    <external xml:id="-1080-19-36-1-118-124-109-91-1235051-110-78-3819" tgt="cm" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/doc/macros" url="https://svn.kwarc.info/repos/cmueller/macros" rev="-1"/>
    <external xml:id="1948-111-120-1219-680-94-5510787-11711252-127" tgt="florian" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/doc/macros" url="https://svn.kwarc.info/repos/kwarc/rabe/Program_Data/Latex" rev="-1">
    </external>
    <external xml:id="-47-92-606-73-29-405285-5348-42-11715-73-98" tgt="locutor-test" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects" url="https://svn.kwarc.info/repos/clange/tmp" rev="-1"/>
    <external 
    xml:id="126-5-29-57-6667-11215-22114797-112-52-58" tgt="macros" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects/dockon/doc" url="https://svn.kwarc.info/repos/kwarc/doc/macros" xref="#9-536954-12-99619577212-1053-3871" rev="-1">
</external>
    <external 
    xml:id="18-35-66-29-91-121-6049119-100-8946-44-119-9917" tgt="kwarc" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects/dockon/doc/bibs" url="https://svn.kwarc.info/repos/kwarc/doc/bibs" xref="#9-536954-12-99619577212-1053-3871" rev="-1">
</external>
    <external 
    xml:id="-12157-112-127-3-109-3-455972-79-4316-58796" tgt="bibflorian" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects/LogicAtlas" url="https://kwarc.eecs.iu-bremen.de/repos/kwarc/rabe/Program_Data/Latex/bib" rev="-1">
</external>
    <external xml:id="11463631065512482213744-116-50125274439" tgt="LaTeXML" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects/mmiss" url="https://svn.mathweb.org/repos/LaTeXML/trunk" rev="-1"/>
    <external xml:id="59-20104-40-104127-1017182-67-45-3899-27-8641" tgt="stex" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects/mmiss/sty" url="https://svn.kwarc.info/repos/stex/sty" rev="-1">
      <external 
      xml:id="27-43-108-16-57-15-101-109-381252107-121-78-48-105" tgt="ed" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects/mmiss/sty/stex" url="https://svn.kwarc.info/repos/kwarc/doc/macros/forCTAN/ed" xref="#9-536954-12-99619577212-1053-3871" rev="-1">
</external>
      <external 
      xml:id="39-7-72-23-7089119-9166113-10173-98-14-59-73" tgt="ded" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects/mmiss/sty/stex" url="https://svn.kwarc.info/repos/kwarc/doc/macros/forCTAN/ded" xref="#9-536954-12-99619577212-1053-3871" rev="-1">
</external>
    </external>
  </wc>
</registry>)      
      val r = setupRegistry(xml)
      r.serialize()
      
      XML.loadFile(REG) must ==/(xml)
    }
    "decode such that all transexs are dereferencable (2nd example)" in {
      val xml = 
        (<registry version="0.1" xmlns="http://locutor.kwarc.info">
  <wc xml:id="647-45-85110-74-12595-2933110117-61564949" root="/Users/nmueller/tmp/miko/kwarc.info/stex" url="https://svn.kwarc.info/repos/stex">
    <external xml:id="-297411641251144262664847-6882-96-107" tgt="LaTeXML" own="/Users/nmueller/tmp/miko/kwarc.info/stex" url="https://svn.mathweb.org/repos/LaTeXML/trunk" rev="-1"/>
    <external xml:id="-58-45-120-6810593-104116-11-7554-75110-92-49125" tgt="jomdoc" own="/Users/nmueller/tmp/miko/kwarc.info/stex/bin" url="https://svn.omdoc.org/repos/jomdoc/deploy" rev="-1">
      <external 
      xml:id="62-118-64-5859-115-24-12294120-2056102-86-97108" tgt="lib" own="/Users/nmueller/tmp/miko/kwarc.info/stex/bin/jomdoc/bleeding-edge" url="https://svn.omdoc.org/repos/jomdoc/src/jomdoc/trunk/lib" xref="#-29-84-35-18489185-9962-105-104428-4117-47" rev="-1">
</external>
      <external 
      xml:id="-29-84-35-18489185-9962-105-104428-4117-47" tgt="lib" own="/Users/nmueller/tmp/miko/kwarc.info/stex/bin/jomdoc/latest/jomdoc-0.1.2" url="https://svn.omdoc.org/repos/jomdoc/src/jomdoc/trunk/lib" rev="-1">
</external>
    </external>
    <external xml:id="-74-8781-112-85-13-2579858275-284410010252" tgt="omdoc" own="/Users/nmueller/tmp/miko/kwarc.info/stex/lib" url="https://svn.omdoc.org/repos/omdoc/branches/omdoc-1.2/lib" rev="-1"/>
    <external xml:id="-125-10-6-10477-13-117-92-85-75875298-15-3375" tgt="kwarc" own="/Users/nmueller/tmp/miko/kwarc.info/stex/lib" url="https://svn.kwarc.info/repos/kwarc/doc/lib" rev="-1"/>
    <external xml:id="29-6-101107-372221122-117-108-7891-7310-39115" tgt="omdoc" own="/Users/nmueller/tmp/miko/kwarc.info/stex/rnc" url="https://svn.omdoc.org/repos/omdoc/trunk/schema/rnc" rev="-1">
      <external xml:id="-18-8698-112-8032-10449-108-612310724966233" tgt="omdoc-1.2" own="/Users/nmueller/tmp/miko/kwarc.info/stex/rnc/omdoc" url="https://svn.omdoc.org/repos/omdoc/branches/omdoc-1.2/rnc" rev="-1"/>
    </external>
    <external 
    xml:id="-2312535-10076-52-576480-75-126-93611267091" tgt="LaTeXML" own="/Users/nmueller/tmp/miko/kwarc.info/stex/rnc" url="https://svn.mathweb.org/repos/LaTeXML/trunk/lib/LaTeXML/schema/RelaxNG" xref="#-297411641251144262664847-6882-96-107" rev="-1">
</external>
    <external xml:id="-681051186245-127-2013-127-701080-1618-91-77" tgt="ed" own="/Users/nmueller/tmp/miko/kwarc.info/stex/sty" url="https://svn.kwarc.info/repos/kwarc/doc/macros/forCTAN/ed" rev="-1"/>
    <external xml:id="-32-17-11025-34-3-73994455-9233631478-127" tgt="ded" own="/Users/nmueller/tmp/miko/kwarc.info/stex/sty" url="https://svn.kwarc.info/repos/kwarc/doc/macros/forCTAN/ded" rev="-1"/>
    <external xml:id="-572524506441-43847386-70-961131237361" tgt="omdoc" own="/Users/nmueller/tmp/miko/kwarc.info/stex/xsl" url="https://svn.omdoc.org/repos/jomdoc/src/prj/style/trunk/xsl" rev="-1"/>
  </wc>
</registry>)
      val r = setupRegistry(xml)
      r.serialize()
      
      XML.loadFile(REG) must ==/(xml)
    }
    "decode such that all transexs are dereferencable (3rd example)" in {
      val xml = 
        (<registry version="0.1" xmlns="http://locutor.kwarc.info">
  <wc xml:id="647-45-85110-74-12595-2933110117-61564949" root="/Users/nmueller/tmp/miko/kwarc.info/stex" url="https://svn.kwarc.info/repos/stex">
    <external xml:id="-297411641251144262664847-6882-96-107" tgt="LaTeXML" own="/Users/nmueller/tmp/miko/kwarc.info/stex" url="https://svn.mathweb.org/repos/LaTeXML/trunk" rev="-1"/>
    <external xml:id="-58-45-120-6810593-104116-11-7554-75110-92-49125" tgt="jomdoc" own="/Users/nmueller/tmp/miko/kwarc.info/stex/bin" url="https://svn.omdoc.org/repos/jomdoc/deploy" rev="-1">
      <external 
      xml:id="62-118-64-5859-115-24-12294120-2056102-86-97108" tgt="lib" own="/Users/nmueller/tmp/miko/kwarc.info/stex/bin/jomdoc/bleeding-edge" url="https://svn.omdoc.org/repos/jomdoc/src/jomdoc/trunk/lib" rev="-1">
</external>
      <external 
      xml:id="-29-84-35-18489185-9962-105-104428-4117-47" tgt="lib" own="/Users/nmueller/tmp/miko/kwarc.info/stex/bin/jomdoc/latest/jomdoc-0.1.2" url="https://svn.omdoc.org/repos/jomdoc/src/jomdoc/trunk/lib" rev="-1">
</external>
    </external>
    <external xml:id="-74-8781-112-85-13-2579858275-284410010252" tgt="omdoc" own="/Users/nmueller/tmp/miko/kwarc.info/stex/lib" url="https://svn.omdoc.org/repos/omdoc/branches/omdoc-1.2/lib" rev="-1"/>
    <external xml:id="-125-10-6-10477-13-117-92-85-75875298-15-3375" tgt="kwarc" own="/Users/nmueller/tmp/miko/kwarc.info/stex/lib" url="https://svn.kwarc.info/repos/kwarc/doc/lib" rev="-1"/>
    <external xml:id="29-6-101107-372221122-117-108-7891-7310-39115" tgt="omdoc" own="/Users/nmueller/tmp/miko/kwarc.info/stex/rnc" url="https://svn.omdoc.org/repos/omdoc/trunk/schema/rnc" rev="-1">
      <external xml:id="-18-8698-112-8032-10449-108-612310724966233" tgt="omdoc-1.2" own="/Users/nmueller/tmp/miko/kwarc.info/stex/rnc/omdoc" url="https://svn.omdoc.org/repos/omdoc/branches/omdoc-1.2/rnc" rev="-1"/>
    </external>
    <external xml:id="-2312535-10076-52-576480-75-126-93611267091" tgt="LaTeXML" own="/Users/nmueller/tmp/miko/kwarc.info/stex/rnc" url="https://svn.mathweb.org/repos/LaTeXML/trunk/lib/LaTeXML/schema/RelaxNG" rev="-1">
    </external>
    <external xml:id="-681051186245-127-2013-127-701080-1618-91-77" tgt="ed" own="/Users/nmueller/tmp/miko/kwarc.info/stex/sty" url="https://svn.kwarc.info/repos/kwarc/doc/macros/forCTAN/ed" rev="-1"/>
    <external xml:id="-32-17-11025-34-3-73994455-9233631478-127" tgt="ded" own="/Users/nmueller/tmp/miko/kwarc.info/stex/sty" url="https://svn.kwarc.info/repos/kwarc/doc/macros/forCTAN/ded" rev="-1"/>
    <external xml:id="-572524506441-43847386-70-961131237361" tgt="omdoc" own="/Users/nmueller/tmp/miko/kwarc.info/stex/xsl" url="https://svn.omdoc.org/repos/jomdoc/src/prj/style/trunk/xsl" rev="-1"/>
  </wc>
  <wc xml:id="9-536954-12-99619577212-1053-3871" root="/Users/nmueller/tmp/miko/kwarc.info/kwarc" url="https://svn.kwarc.info/repos/kwarc">
    <external 
    xml:id="-124-799810310926-321961103926-786-20-2" tgt="jem" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/administration/finances" url="https://svn.kwarc.info/repos/kwarc/projects/JEM/eu" xref="#9-536954-12-99619577212-1053-3871" rev="-1">
</external>
    <external xml:id="89-43-12653-11-11885-12-916248-61-34-1057366" tgt="once-cs" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/administration/finances" url="https://svn.kwarc.info/repos/once-cs/admin/contract" rev="-1">
    </external>
    <external xml:id="11-1763-6518771-106125-98-5861-367490-21" tgt="panta-rhei" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/doc/flyers" url="https://svn.kwarc.info/repos/pantarhei/doc/flyer" rev="-1"/>
    <external xml:id="-54-10642-78-6133-63-101828253126-3690-79-64" tgt="swim" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/doc/flyers" url="https://svn.kwarc.info/repos/swim/doc/flyer" rev="-1"/>
    <external xml:id="-1080-19-36-1-118-124-109-91-1235051-110-78-3819" tgt="cm" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/doc/macros" url="https://svn.kwarc.info/repos/cmueller/macros" rev="-1"/>
    <external xml:id="1948-111-120-1219-680-94-5510787-11711252-127" tgt="florian" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/doc/macros" url="https://svn.kwarc.info/repos/kwarc/rabe/Program_Data/Latex" rev="-1">
    </external>
    <external xml:id="-47-92-606-73-29-405285-5348-42-11715-73-98" tgt="locutor-test" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects" url="https://svn.kwarc.info/repos/clange/tmp" rev="-1"/>
    <external 
    xml:id="126-5-29-57-6667-11215-22114797-112-52-58" tgt="macros" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects/dockon/doc" url="https://svn.kwarc.info/repos/kwarc/doc/macros" xref="#9-536954-12-99619577212-1053-3871" rev="-1">
</external>
    <external 
    xml:id="18-35-66-29-91-121-6049119-100-8946-44-119-9917" tgt="kwarc" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects/dockon/doc/bibs" url="https://svn.kwarc.info/repos/kwarc/doc/bibs" xref="#9-536954-12-99619577212-1053-3871" rev="-1">
</external>
    <external 
    xml:id="-12157-112-127-3-109-3-455972-79-4316-58796" tgt="bibflorian" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects/LogicAtlas" url="https://kwarc.eecs.iu-bremen.de/repos/kwarc/rabe/Program_Data/Latex/bib" rev="-1">
</external>
    <external 
    xml:id="11463631065512482213744-116-50125274439" tgt="LaTeXML" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects/mmiss" url="https://svn.mathweb.org/repos/LaTeXML/trunk" xref="#-297411641251144262664847-6882-96-107" rev="-1">
</external>
    <external 
    xml:id="59-20104-40-104127-1017182-67-45-3899-27-8641" tgt="stex" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects/mmiss/sty" url="https://svn.kwarc.info/repos/stex/sty" xref="#647-45-85110-74-12595-2933110117-61564949" rev="-1">
</external>
  </wc>
</registry>)
      val r = setupRegistry(xml)
      r.serialize()
      
      XML.loadFile(REG) must ==/(xml)
    }
    "decode such that all transexs are dereferencable (4th example)" in {
      val xml = 
        (<registry version="0.1" xmlns="http://locutor.kwarc.info">
  <wc xml:id="647-45-85110-74-12595-2933110117-61564949" root="/Users/nmueller/tmp/miko/kwarc.info/stex" url="https://svn.kwarc.info/repos/stex">
    <external 
    xml:id="-297411641251144262664847-6882-96-107" tgt="LaTeXML" own="/Users/nmueller/tmp/miko/kwarc.info/stex" url="https://svn.mathweb.org/repos/LaTeXML/trunk" xref="#11463631065512482213744-116-50125274439" rev="-1">
</external>
    <external xml:id="-58-45-120-6810593-104116-11-7554-75110-92-49125" tgt="jomdoc" own="/Users/nmueller/tmp/miko/kwarc.info/stex/bin" url="https://svn.omdoc.org/repos/jomdoc/deploy" rev="-1">
      <external 
      xml:id="62-118-64-5859-115-24-12294120-2056102-86-97108" tgt="lib" own="/Users/nmueller/tmp/miko/kwarc.info/stex/bin/jomdoc/bleeding-edge" url="https://svn.omdoc.org/repos/jomdoc/src/jomdoc/trunk/lib" xref="#-29-84-35-18489185-9962-105-104428-4117-47" rev="-1">
</external>
      <external 
      xml:id="-29-84-35-18489185-9962-105-104428-4117-47" tgt="lib" own="/Users/nmueller/tmp/miko/kwarc.info/stex/bin/jomdoc/latest/jomdoc-0.1.2" url="https://svn.omdoc.org/repos/jomdoc/src/jomdoc/trunk/lib" rev="-1">
</external>
    </external>
    <external xml:id="-74-8781-112-85-13-2579858275-284410010252" tgt="omdoc" own="/Users/nmueller/tmp/miko/kwarc.info/stex/lib" url="https://svn.omdoc.org/repos/omdoc/branches/omdoc-1.2/lib" rev="-1"/>
    <external 
    xml:id="-125-10-6-10477-13-117-92-85-75875298-15-3375" tgt="kwarc" own="/Users/nmueller/tmp/miko/kwarc.info/stex/lib" url="https://svn.kwarc.info/repos/kwarc/doc/lib" xref="#9-536954-12-99619577212-1053-3871" rev="-1">
</external>
    <external xml:id="29-6-101107-372221122-117-108-7891-7310-39115" tgt="omdoc" own="/Users/nmueller/tmp/miko/kwarc.info/stex/rnc" url="https://svn.omdoc.org/repos/omdoc/trunk/schema/rnc" rev="-1">
      <external xml:id="-18-8698-112-8032-10449-108-612310724966233" tgt="omdoc-1.2" own="/Users/nmueller/tmp/miko/kwarc.info/stex/rnc/omdoc" url="https://svn.omdoc.org/repos/omdoc/branches/omdoc-1.2/rnc" rev="-1"/>
    </external>
    <external 
    xml:id="-2312535-10076-52-576480-75-126-93611267091" tgt="LaTeXML" own="/Users/nmueller/tmp/miko/kwarc.info/stex/rnc" url="https://svn.mathweb.org/repos/LaTeXML/trunk/lib/LaTeXML/schema/RelaxNG" xref="#11463631065512482213744-116-50125274439" rev="-1">
</external>
    <external 
    xml:id="-681051186245-127-2013-127-701080-1618-91-77" tgt="ed" own="/Users/nmueller/tmp/miko/kwarc.info/stex/sty" url="https://svn.kwarc.info/repos/kwarc/doc/macros/forCTAN/ed" xref="#9-536954-12-99619577212-1053-3871" rev="-1">
</external>
    <external 
    xml:id="-32-17-11025-34-3-73994455-9233631478-127" tgt="ded" own="/Users/nmueller/tmp/miko/kwarc.info/stex/sty" url="https://svn.kwarc.info/repos/kwarc/doc/macros/forCTAN/ded" xref="#9-536954-12-99619577212-1053-3871" rev="-1">
</external>
    <external xml:id="-572524506441-43847386-70-961131237361" tgt="omdoc" own="/Users/nmueller/tmp/miko/kwarc.info/stex/xsl" url="https://svn.omdoc.org/repos/jomdoc/src/prj/style/trunk/xsl" rev="-1"/>
  </wc>
  <wc xml:id="9-536954-12-99619577212-1053-3871" root="/Users/nmueller/tmp/miko/kwarc.info/kwarc" url="https://svn.kwarc.info/repos/kwarc">
    <external xml:id="-124-799810310926-321961103926-786-20-2" tgt="jem" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/administration/finances" url="https://svn.kwarc.info/repos/kwarc/projects/JEM/eu" rev="-1"/>
    <external xml:id="89-43-12653-11-11885-12-916248-61-34-1057366" tgt="once-cs" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/administration/finances" url="https://svn.kwarc.info/repos/once-cs/admin/contract" rev="-1">
    </external>
    <external xml:id="11-1763-6518771-106125-98-5861-367490-21" tgt="panta-rhei" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/doc/flyers" url="https://svn.kwarc.info/repos/pantarhei/doc/flyer" rev="-1"/>
    <external xml:id="-54-10642-78-6133-63-101828253126-3690-79-64" tgt="swim" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/doc/flyers" url="https://svn.kwarc.info/repos/swim/doc/flyer" rev="-1"/>
    <external xml:id="-1080-19-36-1-118-124-109-91-1235051-110-78-3819" tgt="cm" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/doc/macros" url="https://svn.kwarc.info/repos/cmueller/macros" rev="-1"/>
    <external xml:id="1948-111-120-1219-680-94-5510787-11711252-127" tgt="florian" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/doc/macros" url="https://svn.kwarc.info/repos/kwarc/rabe/Program_Data/Latex" rev="-1">
    </external>
    <external xml:id="-47-92-606-73-29-405285-5348-42-11715-73-98" tgt="locutor-test" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects" url="https://svn.kwarc.info/repos/clange/tmp" rev="-1"/>
    <external xml:id="126-5-29-57-6667-11215-22114797-112-52-58" tgt="macros" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects/dockon/doc" url="https://svn.kwarc.info/repos/kwarc/doc/macros" rev="-1">
      <external xml:id="-72-10622101-59-72-43-80-39324240-115160-62" tgt="cm" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects/dockon/doc/macros" url="https://svn.kwarc.info/repos/cmueller/macros" rev="-1"/>
      <external 
      xml:id="79-12734-14-9105-7081-112-4012082-24635-103" tgt="florian" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects/dockon/doc/macros" url="https://svn.kwarc.info/repos/kwarc/rabe/Program_Data/Latex" rev="-1">
</external>
    </external>
    <external xml:id="18-35-66-29-91-121-6049119-100-8946-44-119-9917" tgt="kwarc" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects/dockon/doc/bibs" url="https://svn.kwarc.info/repos/kwarc/doc/bibs" rev="-1">
    </external>
    <external 
    xml:id="-12157-112-127-3-109-3-455972-79-4316-58796" tgt="bibflorian" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects/LogicAtlas" url="https://kwarc.eecs.iu-bremen.de/repos/kwarc/rabe/Program_Data/Latex/bib" rev="-1">
</external>
    <external xml:id="11463631065512482213744-116-50125274439" tgt="LaTeXML" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects/mmiss" url="https://svn.mathweb.org/repos/LaTeXML/trunk" rev="-1"/>
    <external xml:id="59-20104-40-104127-1017182-67-45-3899-27-8641" tgt="stex" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects/mmiss/sty" url="https://svn.kwarc.info/repos/stex/sty" rev="-1">
      <external 
      xml:id="27-43-108-16-57-15-101-109-381252107-121-78-48-105" tgt="ed" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects/mmiss/sty/stex" url="https://svn.kwarc.info/repos/kwarc/doc/macros/forCTAN/ed" rev="-1">
</external>
      <external xml:id="39-7-72-23-7089119-9166113-10173-98-14-59-73" tgt="ded" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects/mmiss/sty/stex" url="https://svn.kwarc.info/repos/kwarc/doc/macros/forCTAN/ded" rev="-1">
      </external>
    </external>
  </wc>
</registry>)
      val r = setupRegistry(xml)
      r.serialize()
      
      XML.loadFile(REG) must ==/(xml)
    }
    "decode such that all transexs are dereferencable (5th example)" in {
      val xml = 
        (<registry version="0.1" xmlns="http://locutor.kwarc.info">
  <wc xml:id="647-45-85110-74-12595-2933110117-61564949" root="/Users/nmueller/tmp/miko/kwarc.info/stex" url="https://svn.kwarc.info/repos/stex">
    <external xml:id="-297411641251144262664847-6882-96-107" tgt="LaTeXML" own="/Users/nmueller/tmp/miko/kwarc.info/stex" url="https://svn.mathweb.org/repos/LaTeXML/trunk" rev="-1"/>
    <external xml:id="-58-45-120-6810593-104116-11-7554-75110-92-49125" tgt="jomdoc" own="/Users/nmueller/tmp/miko/kwarc.info/stex/bin" url="https://svn.omdoc.org/repos/jomdoc/deploy" rev="-1">
      <external 
      xml:id="62-118-64-5859-115-24-12294120-2056102-86-97108" tgt="lib" own="/Users/nmueller/tmp/miko/kwarc.info/stex/bin/jomdoc/bleeding-edge" url="https://svn.omdoc.org/repos/jomdoc/src/jomdoc/trunk/lib" xref="#-29-84-35-18489185-9962-105-104428-4117-47" rev="-1">
</external>
      <external 
      xml:id="-29-84-35-18489185-9962-105-104428-4117-47" tgt="lib" own="/Users/nmueller/tmp/miko/kwarc.info/stex/bin/jomdoc/latest/jomdoc-0.1.2" url="https://svn.omdoc.org/repos/jomdoc/src/jomdoc/trunk/lib" rev="-1">
</external>
    </external>
    <external xml:id="-74-8781-112-85-13-2579858275-284410010252" tgt="omdoc" own="/Users/nmueller/tmp/miko/kwarc.info/stex/lib" url="https://svn.omdoc.org/repos/omdoc/branches/omdoc-1.2/lib" rev="-1"/>
    <external 
    xml:id="-125-10-6-10477-13-117-92-85-75875298-15-3375" tgt="kwarc" own="/Users/nmueller/tmp/miko/kwarc.info/stex/lib" url="https://svn.kwarc.info/repos/kwarc/doc/lib" xref="#9-536954-12-99619577212-1053-3871" rev="-1">
</external>
    <external xml:id="29-6-101107-372221122-117-108-7891-7310-39115" tgt="omdoc" own="/Users/nmueller/tmp/miko/kwarc.info/stex/rnc" url="https://svn.omdoc.org/repos/omdoc/trunk/schema/rnc" rev="-1">
      <external xml:id="-18-8698-112-8032-10449-108-612310724966233" tgt="omdoc-1.2" own="/Users/nmueller/tmp/miko/kwarc.info/stex/rnc/omdoc" url="https://svn.omdoc.org/repos/omdoc/branches/omdoc-1.2/rnc" rev="-1"/>
    </external>
    <external 
    xml:id="-2312535-10076-52-576480-75-126-93611267091" tgt="LaTeXML" own="/Users/nmueller/tmp/miko/kwarc.info/stex/rnc" url="https://svn.mathweb.org/repos/LaTeXML/trunk/lib/LaTeXML/schema/RelaxNG" xref="#-297411641251144262664847-6882-96-107" rev="-1">
</external>
    <external 
    xml:id="-681051186245-127-2013-127-701080-1618-91-77" tgt="ed" own="/Users/nmueller/tmp/miko/kwarc.info/stex/sty" url="https://svn.kwarc.info/repos/kwarc/doc/macros/forCTAN/ed" xref="#9-536954-12-99619577212-1053-3871" rev="-1">
</external>
    <external 
    xml:id="-32-17-11025-34-3-73994455-9233631478-127" tgt="ded" own="/Users/nmueller/tmp/miko/kwarc.info/stex/sty" url="https://svn.kwarc.info/repos/kwarc/doc/macros/forCTAN/ded" xref="#9-536954-12-99619577212-1053-3871" rev="-1">
</external>
    <external xml:id="-572524506441-43847386-70-961131237361" tgt="omdoc" own="/Users/nmueller/tmp/miko/kwarc.info/stex/xsl" url="https://svn.omdoc.org/repos/jomdoc/src/prj/style/trunk/xsl" rev="-1"/>
  </wc>
  <wc xml:id="9-536954-12-99619577212-1053-3871" root="/Users/nmueller/tmp/miko/kwarc.info/kwarc" url="https://svn.kwarc.info/repos/kwarc">
    <external 
    xml:id="-124-799810310926-321961103926-786-20-2" tgt="jem" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/administration/finances" url="https://svn.kwarc.info/repos/kwarc/projects/JEM/eu" xref="#9-536954-12-99619577212-1053-3871" rev="-1">
</external>
    <external xml:id="89-43-12653-11-11885-12-916248-61-34-1057366" tgt="once-cs" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/administration/finances" url="https://svn.kwarc.info/repos/once-cs/admin/contract" rev="-1">
    </external>
    <external xml:id="11-1763-6518771-106125-98-5861-367490-21" tgt="panta-rhei" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/doc/flyers" url="https://svn.kwarc.info/repos/pantarhei/doc/flyer" rev="-1"/>
    <external xml:id="-54-10642-78-6133-63-101828253126-3690-79-64" tgt="swim" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/doc/flyers" url="https://svn.kwarc.info/repos/swim/doc/flyer" rev="-1"/>
    <external xml:id="-1080-19-36-1-118-124-109-91-1235051-110-78-3819" tgt="cm" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/doc/macros" url="https://svn.kwarc.info/repos/cmueller/macros" rev="-1"/>
    <external xml:id="1948-111-120-1219-680-94-5510787-11711252-127" tgt="florian" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/doc/macros" url="https://svn.kwarc.info/repos/kwarc/rabe/Program_Data/Latex" rev="-1">
    </external>
    <external xml:id="-47-92-606-73-29-405285-5348-42-11715-73-98" tgt="locutor-test" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects" url="https://svn.kwarc.info/repos/clange/tmp" rev="-1"/>
    <external 
    xml:id="126-5-29-57-6667-11215-22114797-112-52-58" tgt="macros" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects/dockon/doc" url="https://svn.kwarc.info/repos/kwarc/doc/macros" xref="#9-536954-12-99619577212-1053-3871" rev="-1">
</external>
    <external 
    xml:id="18-35-66-29-91-121-6049119-100-8946-44-119-9917" tgt="kwarc" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects/dockon/doc/bibs" url="https://svn.kwarc.info/repos/kwarc/doc/bibs" xref="#9-536954-12-99619577212-1053-3871" rev="-1">
</external>
    <external 
    xml:id="-12157-112-127-3-109-3-455972-79-4316-58796" tgt="bibflorian" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects/LogicAtlas" url="https://kwarc.eecs.iu-bremen.de/repos/kwarc/rabe/Program_Data/Latex/bib" rev="-1">
</external>
    <external 
    xml:id="11463631065512482213744-116-50125274439" tgt="LaTeXML" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects/mmiss" url="https://svn.mathweb.org/repos/LaTeXML/trunk" xref="#-297411641251144262664847-6882-96-107" rev="-1">
</external>
    <external 
    xml:id="59-20104-40-104127-1017182-67-45-3899-27-8641" tgt="stex" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects/mmiss/sty" url="https://svn.kwarc.info/repos/stex/sty" xref="#647-45-85110-74-12595-2933110117-61564949" rev="-1">
</external>
  </wc>
</registry>)
      val r = setupRegistry(xml)
      r.serialize()
      
      XML.loadFile(REG) must ==/(xml)
    }
    "decode such that all transexs are dereferencable (6th example)" in {
      val xml = 
        (<registry version="0.1" xmlns="http://locutor.kwarc.info">
  <wc xml:id="647-45-85110-74-12595-2933110117-61564949" root="/Users/nmueller/tmp/miko/kwarc.info/stex" url="https://svn.kwarc.info/repos/stex">
    <external 
    xml:id="-297411641251144262664847-6882-96-107" tgt="LaTeXML" own="/Users/nmueller/tmp/miko/kwarc.info/stex" url="https://svn.mathweb.org/repos/LaTeXML/trunk" xref="#11463631065512482213744-116-50125274439" rev="-1">
</external>
    <external xml:id="-58-45-120-6810593-104116-11-7554-75110-92-49125" tgt="jomdoc" own="/Users/nmueller/tmp/miko/kwarc.info/stex/bin" url="https://svn.omdoc.org/repos/jomdoc/deploy" rev="-1">
      <external 
      xml:id="62-118-64-5859-115-24-12294120-2056102-86-97108" tgt="lib" own="/Users/nmueller/tmp/miko/kwarc.info/stex/bin/jomdoc/bleeding-edge" url="https://svn.omdoc.org/repos/jomdoc/src/jomdoc/trunk/lib" xref="#-29-84-35-18489185-9962-105-104428-4117-47" rev="-1">
</external>
      <external 
      xml:id="-29-84-35-18489185-9962-105-104428-4117-47" tgt="lib" own="/Users/nmueller/tmp/miko/kwarc.info/stex/bin/jomdoc/latest/jomdoc-0.1.2" url="https://svn.omdoc.org/repos/jomdoc/src/jomdoc/trunk/lib" rev="-1">
</external>
    </external>
    <external xml:id="-74-8781-112-85-13-2579858275-284410010252" tgt="omdoc" own="/Users/nmueller/tmp/miko/kwarc.info/stex/lib" url="https://svn.omdoc.org/repos/omdoc/branches/omdoc-1.2/lib" rev="-1"/>
    <external 
    xml:id="-125-10-6-10477-13-117-92-85-75875298-15-3375" tgt="kwarc" own="/Users/nmueller/tmp/miko/kwarc.info/stex/lib" url="https://svn.kwarc.info/repos/kwarc/doc/lib" xref="#9-536954-12-99619577212-1053-3871" rev="-1">
</external>
    <external xml:id="29-6-101107-372221122-117-108-7891-7310-39115" tgt="omdoc" own="/Users/nmueller/tmp/miko/kwarc.info/stex/rnc" url="https://svn.omdoc.org/repos/omdoc/trunk/schema/rnc" rev="-1">
      <external xml:id="-18-8698-112-8032-10449-108-612310724966233" tgt="omdoc-1.2" own="/Users/nmueller/tmp/miko/kwarc.info/stex/rnc/omdoc" url="https://svn.omdoc.org/repos/omdoc/branches/omdoc-1.2/rnc" rev="-1"/>
    </external>
    <external 
    xml:id="-2312535-10076-52-576480-75-126-93611267091" tgt="LaTeXML" own="/Users/nmueller/tmp/miko/kwarc.info/stex/rnc" url="https://svn.mathweb.org/repos/LaTeXML/trunk/lib/LaTeXML/schema/RelaxNG" xref="#11463631065512482213744-116-50125274439" rev="-1">
</external>
    <external 
    xml:id="-681051186245-127-2013-127-701080-1618-91-77" tgt="ed" own="/Users/nmueller/tmp/miko/kwarc.info/stex/sty" url="https://svn.kwarc.info/repos/kwarc/doc/macros/forCTAN/ed" xref="#9-536954-12-99619577212-1053-3871" rev="-1">
</external>
    <external 
    xml:id="-32-17-11025-34-3-73994455-9233631478-127" tgt="ded" own="/Users/nmueller/tmp/miko/kwarc.info/stex/sty" url="https://svn.kwarc.info/repos/kwarc/doc/macros/forCTAN/ded" xref="#9-536954-12-99619577212-1053-3871" rev="-1">
</external>
    <external xml:id="-572524506441-43847386-70-961131237361" tgt="omdoc" own="/Users/nmueller/tmp/miko/kwarc.info/stex/xsl" url="https://svn.omdoc.org/repos/jomdoc/src/prj/style/trunk/xsl" rev="-1"/>
  </wc>
  <wc xml:id="9-536954-12-99619577212-1053-3871" root="/Users/nmueller/tmp/miko/kwarc.info/kwarc" url="https://svn.kwarc.info/repos/kwarc">
    <external 
    xml:id="-124-799810310926-321961103926-786-20-2" tgt="jem" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/administration/finances" url="https://svn.kwarc.info/repos/kwarc/projects/JEM/eu" xref="#9-536954-12-99619577212-1053-3871" rev="-1">
</external>
    <external xml:id="89-43-12653-11-11885-12-916248-61-34-1057366" tgt="once-cs" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/administration/finances" url="https://svn.kwarc.info/repos/once-cs/admin/contract" rev="-1">
    </external>
    <external xml:id="11-1763-6518771-106125-98-5861-367490-21" tgt="panta-rhei" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/doc/flyers" url="https://svn.kwarc.info/repos/pantarhei/doc/flyer" rev="-1"/>
    <external xml:id="-54-10642-78-6133-63-101828253126-3690-79-64" tgt="swim" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/doc/flyers" url="https://svn.kwarc.info/repos/swim/doc/flyer" rev="-1"/>
    <external xml:id="-1080-19-36-1-118-124-109-91-1235051-110-78-3819" tgt="cm" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/doc/macros" url="https://svn.kwarc.info/repos/cmueller/macros" rev="-1"/>
    <external xml:id="1948-111-120-1219-680-94-5510787-11711252-127" tgt="florian" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/doc/macros" url="https://svn.kwarc.info/repos/kwarc/rabe/Program_Data/Latex" rev="-1">
    </external>
    <external xml:id="-47-92-606-73-29-405285-5348-42-11715-73-98" tgt="locutor-test" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects" url="https://svn.kwarc.info/repos/clange/tmp" rev="-1"/>
    <external 
    xml:id="126-5-29-57-6667-11215-22114797-112-52-58" tgt="macros" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects/dockon/doc" url="https://svn.kwarc.info/repos/kwarc/doc/macros" xref="#9-536954-12-99619577212-1053-3871" rev="-1">
</external>
    <external 
    xml:id="18-35-66-29-91-121-6049119-100-8946-44-119-9917" tgt="kwarc" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects/dockon/doc/bibs" url="https://svn.kwarc.info/repos/kwarc/doc/bibs" xref="#9-536954-12-99619577212-1053-3871" rev="-1">
</external>
    <external 
    xml:id="-12157-112-127-3-109-3-455972-79-4316-58796" tgt="bibflorian" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects/LogicAtlas" url="https://kwarc.eecs.iu-bremen.de/repos/kwarc/rabe/Program_Data/Latex/bib" rev="-1">
</external>
    <external xml:id="11463631065512482213744-116-50125274439" tgt="LaTeXML" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects/mmiss" url="https://svn.mathweb.org/repos/LaTeXML/trunk" rev="-1"/>
    <external 
    xml:id="59-20104-40-104127-1017182-67-45-3899-27-8641" tgt="stex" own="/Users/nmueller/tmp/miko/kwarc.info/kwarc/projects/mmiss/sty" url="https://svn.kwarc.info/repos/stex/sty" xref="#647-45-85110-74-12595-2933110117-61564949" rev="-1">
</external>
  </wc>
</registry>)
      val r = setupRegistry(xml)
      r.serialize()
      
      XML.loadFile(REG) must ==/(xml)
    }
  }
}
